package org.jeecg.modules.nikeProject.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.nikeProject.service.IParseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(tags="解析")
@RestController
@RequestMapping("/parse")
public class ParseController {
    @Autowired
    private IParseService iParseService;

    @AutoLog(value = "解析历史数据2024")
    @ApiOperation(value="解析历史数据2024", notes="解析历史数据2024")
    @GetMapping(value = "/applyData")
    public Result<?> applyData(){
        return iParseService.parseApplyData();
    }

    @AutoLog(value = "解析历史数据2017-2020")
    @ApiOperation(value="解析历史数据2017-2020", notes="解析历史数据2017-2020")
    @GetMapping(value = "/parseHisTopData")
    public Result<?> parseHisTopData(){
        return iParseService.parseHisTopData();
    }

    @AutoLog(value = "解析历史数据2022-2023")
    @ApiOperation(value="解析历史数据2022-2023", notes="解析历史数据2022-2023")
    @GetMapping(value = "/parseHisData")
    public Result<?> parseHisData(){
        return iParseService.parseHisData();
    }

    @AutoLog(value = "省市区数据入redis")
    @ApiOperation(value="省市区数据入redis", notes="省市区数据入redis")
    @GetMapping(value = "/setAreaToRedis")
    public Result<?> setAreaToRedis(){
        return iParseService.setAreaToRedis();
    }
    /**
     * 解析原始评审入库
     */
    @AutoLog(value = "解析原始评审入库")
    @ApiOperation(value="解析原始评审入库", notes="解析原始评审入库")
    @GetMapping(value = "/parseJudge")
    public Result<?> parseJudge(){
        return iParseService.parseJudge();
    }

    @AutoLog(value = "导入评审数据")
    @ApiOperation(value="导入评审数据", notes="导入评审数据")
    @GetMapping(value = "/parseExcelToJson")
    public Result<?> parseExcelToJson(){
        return iParseService.parseExcelToJson();
    }

    @GetMapping(value = "/parseRepresentativeResult")
    public Result<?> parseRepresentativeResult(@RequestParam("projectId") String projectId){
        return iParseService.parseRepresentativeResult(projectId);
    }

    @AutoLog(value = "解析视频数据入库")
    @ApiOperation(value="解析视频数据入库", notes="解析视频数据入库")
    @GetMapping(value = "/parseShipin")
    public Result<?> parseShipin(){
        return iParseService.parseShipin();
    }
    @AutoLog(value = "解析最新省市区数据入库")
    @ApiOperation(value="解析最新省市区数据入库", notes="解析最新省市区数据入库")
    @GetMapping(value = "/parseArea")
    public Result<?> parseArea() throws Exception{
        return iParseService.parseArea();
    }

}
